/*
                    MouseContextMenu Class Definition
*/

#ifndef MOUSECONTEXTMENU_H
#define MOUSECONTEXTMENU_H

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include <vector>
#include <string>

#include "../NetworkDefinitions.h"
#include "../Functions.h"
#include "../GUISystem\Label.h"

struct ContextMenuItem
{
    ContextMenuItem()
    {
        bMouseOver = false;
    }

    Label lblNormal, lblHover;
    bool bMouseOver;
};

class MouseContextMenu
{
    public:
        MouseContextMenu();
        ~MouseContextMenu();

        void Initialise(const string& strNewName, const vector<string>& NewItems, const int& iNewFontSize, SDL_Color Colour, SDL_Color MouseoverColour,
                        const int& iVPadding, const int& iHPadding, const int& iSpacing, const string& strHeaderBG, const string& strFooterBG, const string& strBackBG);

        void OpenMenu(const Point& OpenPosition, const string& strTargetData);
        void CloseMenu();

        void HandleMouseMotion(const int& iMouseXREL, const int& iMouseYREL);
        string HandleMouseUp(int iMouseX, int iMouseY);

        void BlitToSurface(SDL_Surface *surface);

        void setName(const string& strNewName);
        string getName();

        void setTargetData(const string& strNewTargetData);
        string getTargetData();

        void setFontSize(const int& iNewFontSize);
        int getFontSize();

    private:
        string strName;
        string strMenuTargetData;

        int iFontSize;

        Point Position;

        bool bVisible;

        SDL_Surface *Background;

        vector<ContextMenuItem*> MenuItems;
};

#endif
